package aiingames.simulation.agent;

import com.vividsolutions.jts.geom.Coordinate;

public class AgentAction {

	public static enum SimpleAction {LEFT, RIGHT, STOP};
	
	private Coordinate dest;
	private double v;

	public AgentAction(Coordinate dest, double v) {
		this.dest = dest;
		this.v = v;
	}
	
	public Coordinate getDestination() {
		return this.dest;
	}
	
	public double getVelocity() {
		return this.v;
	}
	
	public static AgentAction translateSimpleAction(SimpleAction a) {
		if (a == SimpleAction.LEFT) {
			return new AgentAction(new Coordinate(-1,0),1);
		} else if (a == SimpleAction.RIGHT) {
			return new AgentAction(new Coordinate(1,0),1);
		} else if (a == SimpleAction.STOP){
			return new AgentAction(new Coordinate(0,0),0);
		} else {
			
			throw new RuntimeException("Unknown simple action:" +a + "|a:" + a);
		}
	}
}
